package com.walle.concurrenttest.pattern.balking;

/**
 * @author zhangjiapeng
 * @Package com.walle.concurrenttest.pattern.balking
 * @Description: ${todo}
 * @date 2019/2/19 11:26
 */
public class SaveThread implements Runnable {

    private Data data;

    public SaveThread(Data data) {
        this.data = data;
    }

    @Override
    public void run() {
        try {
            while (true){
                data.save();
                Thread.sleep(1000);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
